<%@ page import="java.util.Properties" %>
<%@ page import="java.io.*" %><%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025-08-03
  Time: 8:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    String username=request.getParameter("username");
    String email=request.getParameter("email");
    String password=request.getParameter("password");
    Properties  p=new Properties();
    p.setProperty("username",username);
    p.setProperty("email",email);
    p.setProperty("password",password);
    System.out.println(p.toString());
    System.out.println(request.getContextPath());
    String path = application.getRealPath("/user.properties");
    System.out.println(path);
    OutputStream fw=new FileOutputStream(path);
    try {
        p.store(fw, "register  success");
        fw.close();
    }
    catch (IOException e){
        System.out.println(e.getMessage());
    }
%>
   <jsp:forward page="index.jsp"></jsp:forward>
</body>
</html>
